home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 726-750 / 742 / rkrm_lib3 / rkrm_lib3.lha / Math / ffptrans.c < prev    next >
C/C++ Source or Header  |  1992-09-03  |  2KB  |  63 lines

  1. ;/* ffptrans.c - Math FFP Transcendental example of SPSin()
  2. LC -b1 -cfistq -ff -v -y -j73 ffptrans.c
  3. blink lib:c.o+ffptrans.o TO ffptrans LIB lib:lcmffp.lib+lib:lc.lib+lib:amiga.lib
  4. quit
  5. */
  6.  
  7. /*
  8. Copyright (c) 1992 Commodore-Amiga, Inc.
  9.  
  10. This example is provided in electronic form by Commodore-Amiga, Inc. for
  11. use with the "Amiga ROM Kernel Reference Manual: Libraries", 3rd Edition,
  12. published by Addison-Wesley (ISBN 0-201-56774-1).
  13.  
  14. The "Amiga ROM Kernel Reference Manual: Libraries" contains additional
  15. information on the correct usage of the techniques and operating system
  16. functions presented in these examples.  The source and executable code
  17. of these examples may only be distributed in free electronic form, via
  18. bulletin board or as part of a fully non-commercial and freely
  19. redistributable diskette.  Both the source and executable code (including
  20. comments) must be included, without modification, in any copy.  This
  21. example may not be published in printed form or distributed with any
  22. commercial product.  However, the programming techniques and support
  23. routines set forth in these examples may be used in the development
  24. of original executable software products for Commodore Amiga computers.
  25.  
  26. All other rights reserved.
  27.  
  28. This example is provided "as-is" and is subject to change; no
  29. warranties are made.  All use is at your own risk. No liability or
  30. responsibility is assumed.
  31. */
  32.  
  33. /*
  34.  * Run from CLI only!
  35.  */
  36.  
  37. #include <exec/types.h>
  38. #include <libraries/mathffp.h>
  39.  
  40. #include <clib/exec_protos.h>
  41. #include <clib/mathtrans_protos.h>
  42.  
  43. #include <clib/alib_stdio_protos.h>
  44.  
  45. struct Library *MathTransBase;
  46.  
  47. VOID main(void)
  48. {
  49.  
  50. FLOAT num1 = 3.1415926535897/6;  /* 30 degrees in radians */
  51. FLOAT result;
  52.  
  53. if (MathTransBase = OpenLibrary("mathtrans.library",0))
  54.     {
  55.     result = SPSin(num1);
  56.     printf("Num1 = %f and result = %f\n",num1,result);
  57.  
  58.     CloseLibrary(MathTransBase);
  59.     }
  60. else
  61.     printf("Can't open mathffp.library\n");
  62. }
  63.